package edu.lsnu.equipment_management_system.mapper.update;

import edu.lsnu.equipment_management_system.pojo.vo.sql_conditions.DateAndEquipmentNoVo;
import edu.lsnu.equipment_management_system.pojo.vo.sql_conditions.UserNoAndEquipmentNoVo;
import org.apache.ibatis.annotations.Update;

/**
 * @author mzy
 * @Description 从维修中 -> 在用
 * @date 2018/11/20
 */
public interface UpdateEquipmentRepairTableEndDateMapper {
    /**
     * @Description 维修中 -> 在用：添加修护日期2(XHRQ2：结束日期)
     * 【传入设备编号和日期】
     * @author mzy
     * @time 2018-11-21
     * @see
     * @return   int
     * @params  [dateAndEquipmentNoVo]
     */
    @Update("update JBXX_WHWX set XHRQ2 = GETDATE() \n" +
            "where JBXX_WHWX.SBBH = #{equipmentNo} \n" +
            "and XHRQ2 is null\n" +
            "and JBXX_WHWX.ZGH = #{userNo}")
    int repairToUsing(UserNoAndEquipmentNoVo userNoAndEquipmentNoVo);
}
